/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Bone
 */
@Entity
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Fpas.findAll", query = "SELECT f FROM Fpas f")})
public class Fpas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    private Integer codigo;
    @Column(length = 14)
    private String cnae;
    @Column(name = "ALIQUOTA_SAT")
    private Long aliquotaSat;
    @Column(length = 250)
    private String descricao;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "PERCENTUAL_INSS_PATRONAL", precision = 18, scale = 6)
    private BigDecimal percentualInssPatronal;
    @Column(name = "CODIGO_TERCEIRO")
    private Short codigoTerceiro;
    @Column(name = "PERCENTUAL_TERCEIROS", precision = 18, scale = 6)
    private BigDecimal percentualTerceiros;
    @OneToMany(mappedBy = "idFpas")
    private List<Empresa> empresaList;

    public Fpas() {
    }

    public Fpas(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCodigo() {
        return codigo;
    }

    public void setCodigo(Integer codigo) {
        this.codigo = codigo;
    }

    public String getCnae() {
        return cnae;
    }

    public void setCnae(String cnae) {
        this.cnae = cnae;
    }

    public Long getAliquotaSat() {
        return aliquotaSat;
    }

    public void setAliquotaSat(Long aliquotaSat) {
        this.aliquotaSat = aliquotaSat;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public BigDecimal getPercentualInssPatronal() {
        return percentualInssPatronal;
    }

    public void setPercentualInssPatronal(BigDecimal percentualInssPatronal) {
        this.percentualInssPatronal = percentualInssPatronal;
    }

    public Short getCodigoTerceiro() {
        return codigoTerceiro;
    }

    public void setCodigoTerceiro(Short codigoTerceiro) {
        this.codigoTerceiro = codigoTerceiro;
    }

    public BigDecimal getPercentualTerceiros() {
        return percentualTerceiros;
    }

    public void setPercentualTerceiros(BigDecimal percentualTerceiros) {
        this.percentualTerceiros = percentualTerceiros;
    }

    @XmlTransient
    public List<Empresa> getEmpresaList() {
        return empresaList;
    }

    public void setEmpresaList(List<Empresa> empresaList) {
        this.empresaList = empresaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Fpas)) {
            return false;
        }
        Fpas other = (Fpas) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.Fpas[ id=" + id + " ]";
    }
    
}
